#ifndef _RECEIVER_H
#define _RECEIVER_H

#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/exception.hpp>
#include <string>
#include <deque>
#include <list>

#include "Util.hpp"
#include "EventListener.h"

using boost::asio::ip::tcp;
using boost::asio::ip::udp;

class Receiver
{
    public:
        Receiver(tcp::socket* socket, int ID);
        Receiver(udp::socket* socket, int ID);
        ~Receiver();
        void Receive();
        void CreateBuffer( const boost::system::error_code& error,std::size_t bytes_transferred);
        void NotifyListeners();
        void AddListener(EventListener* listener);
        void SetListener(std::list<EventListener*> *listeners);
    private:
    std::list<EventListener*> *mListeners;
    boost::array<char, 32768> buffer_;

};

#endif // _RECEIVER_H
